<?php
//http库
class TbfHttp {
    static function getContent($url){
        return file_get_contents($url);
    }
    static function requestIsPost(){
        return $_SERVER['REQUEST_METHOD'] === 'POST';
    }
    static function addParamToUrl($url,$key,$value){
        if (strpos($url,'?')===false){
            return $url.'?'.urlv($key).'='.urlv($value);
        }
        return $url.'&'.urlv($key).'='.urlv($value);
    }
}